<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<%@include file="frame/common.jsp"%>
<title>应用审批</title>
<style>
.applyinfo {
	padding: 20px 0;
}

.nav-tabs>li.active>a {
	background-color: #E6E5E5;
}

.form-horizontal .control-label {
	text-align: left;
}

.form-horizontal textarea {
	resize: none;
}

#tenantInfoTable table tbody tr td:nth-child(odd) {
	vertical-align: middle;
	text-align: center;
}
</style>
<script type="text/javascript">
	$(function() {
		//loadtenantType();
		validateForm();
	})

	function validateForm() {
		//debugger
		$("#seform").bootstrapValidator({
			fields : {
				remark : {
					validators : {
						notEmpty : {
							message : '请输入审批意见'
						},
						stringLength : {
							min : 0,
							max : 1024,
							message : '请输入一个长度最多是 1024 的字符串'
						}
					}
				}
			}
		});
	}
	
	
</script>
</head>
<body>
	<div class="content">
		<div class="container">
			<div class="row applyinfo">
				<div class="col-md-3">
					<label>标题：</label><span>应用审批</span>
				</div>
				<div class="col-md-3">
					<label>申请时间：</label> <span id="apiApproveStartTime"> 
					<fmt:formatDate	type="date" value="${application.approveStartTime}"	dateStyle="default" />
					</span>
				</div>
			</div>
			<div>
				<!-- Nav tabs -->
				<ul class="nav nav-tabs" role="tablist">
					<li role="presentation" class="active">
						<a href="#home"	aria-controls="home" role="tab" data-toggle="tab">应用审核查看</a>
					</li>
				</ul>

				<!-- Tab panes -->
				<div class="tab-content">
					<div role="tabpanel" class="tab-pane active" id="home">
						<table class="table table-bordered table-hover ">
							<thead>
								<tr>
									<th>应用名称</th>
									<th>应用层级</th>
									<th>应用描述</th>
									<th>应用创建者</th>
									<th>操作类型</th>
									<th>操作请求者</th>
								</tr>
							</thead>
							<thead>
								<tr>
									<th>${application.applicationName}</th>
									<th>${application.tier}</th>
									<th>${application.description}</th>
									<th>${application.applicationCreator}</th>
									<th>
										<c:if test="${application.approveType == 1}">删除</c:if>
                                		<c:if test="${application.approveType == 0}">创建</c:if>
                                	</th>
									<th>${application.approveCreator }</th>
								</tr>
							</thead>
						</table>
						
						<div>
	                    <label class="col-sm-2 control-label">历史审批意见：</label>
		                    <table class="table table-bordered table-hover">
		                        <thead>
		                        <tr>
		                            <th>提交人员</th>
		                            <th>提交时间</th>
		                            <th>是否同意</th>
		                            <th>处理意见</th>
		                        </tr>
		                        </thead>
		                        <tbody id="rowtbody2">
				               <c:forEach items="${recordList }" var="record" >
		                        	<tr>
				                        	<td>${record.approver}</td>
		                            		<td><fmt:formatDate type="date" value="${record.createDate}"  pattern="yyyy-MM-dd HH:mm" /></td>
		                            		<c:if test="${record.recordApproveStatus==1 }">
													<td>同意</td>
											</c:if>
											<c:if test="${record.recordApproveStatus==0 }">
													<td>不同意</td>
											</c:if>
		                            		<td>${record.view }</td>
                        				</tr>
				                    </c:forEach>
		                        </tbody>
		                    </table>
                    </div>
						
						
						<form class="form-horizontal" action="completeAppTask" id="seform" method="post">
							<input type="hidden" name="proInsId" value="${proInsId}" /> <input
								type="hidden" name="taskId" value="${taskId}" /> <input
								type="hidden" name="user" value="${loginUser}" />
							<div class="form-group">
								<label class="col-sm-2 control-label">审批结果：</label>
								<div class="col-sm-10">
									<label class="radio-inline"> <input type="radio"
										name="approvalSumup" id="yesRadio" value="1" checked>
										同意
									</label> <label class="radio-inline"> <input type="radio"
										name="approvalSumup" id="noRadio" value="0"> 不同意
									</label>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">意见：</label>
								<div class="col-sm-12">
									<textarea class="form-control" rows="5" name="remark"
										id="remark"></textarea>
								</div>
							</div>

							<div class="form-group">
								<div class="col-sm-offset-4 col-sm-1">
									<button type="submit" class="btn btn-danger" id="saveBtn">提交</button>
								</div>
								<div class="col-sm-offset-1 col-sm-1">
									<button type="button" class="btn btn-default"
										onclick="javascript:history.go(-1)">取消</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>